export default {
  height: 'auto',
  calcHeight: 30,
  tip: false,
  searchShow: true,
  searchMenuSpan: 6,
  border: true,
  menu: true,
  dialogClickModal: false,
  excelBtn: false,
  refreshBtn: false,
  columnBtn: false,
  stripe: true,
  align: 'center',
  dialogFullscreen: false,
  addBtn: false,
  delBtn: false,
  editBtn: false,
  viewBtn: true,
  column: [
    // {
    //   label: '课件ID',
    //   prop: 'id',
    //   addDisplay: false,
    //   editDisplay: false,
    // },
    {
      label: '课件编号',
      prop: 'code',
      type: 'input',
      rules: [
        {
          required: true,
          message: '请输入课件编号',
          trigger: 'blur',
        },
      ],
    },
    {
      label: '课件类型',
      prop: 'type',
      type: 'select',
      search: true,
      rules: [
        {
          required: true,
          message: '请选择课件类型',
          trigger: 'blur',
        },
      ],
      dicData: [],
    },
    {
      label: '课件名称',
      prop: 'name',
      type: 'input',
      search: true,
      rules: [
        {
          required: true,
          message: '请输入课件名称',
          trigger: 'blur',
        },
      ],
      span: 24,
    },
    {
      label: '课件描述',
      prop: 'note',
      type: 'textarea',
      rules: [
        {
          required: true,
          message: '请输入课件描述',
          trigger: 'blur',
        },
      ],
      span: 24,
    },
    {
      label: '文件',
      prop: 'file',
      type: 'upload',
      
      loadText: '上传中，请稍等',
      hide: true,
      span: 24,
    },
    {
      label: '课件时长',
      prop: 'timeHour',
      rules: [
        {
          trigger: 'blur',
          validator(rule, value, callback) {
            if (!value) {
              return callback(new Error('请输入学习时长'));
            }
            if (value.split('.')[1] && value.split('.')[1].length > 2) {
              return callback(new Error('最多支持2位小数'));
            }
            return true;
          },
        },
      ],
      span: 12,
    },
    // {
    //   label: '学习时长',
    //   prop: 'requireTimeHour',
    //   rules: [
    //     {
    //       trigger: 'blur',
    //       validator(rule, value, callback) {
    //         if (!value) {
    //           return callback(new Error('请输入学习时长'));
    //         }
    //         if (value.split('.')[1] && value.split('.')[1].length > 2) {
    //           return callback(new Error('最多支持2位小数'));
    //         }
    //         return true;
    //       },
    //     },
    //   ],
    //   span: 12,
    // },
  ],
};
